{% extends "base.html" %}

{% block title %}User Search{% endblock %}
{% block crumb %}&rsaquo; User search{% endblock %}

{% block content %}
  <h1>Search for Users</h1>
  <form action="" method="post">
      {% csrf_token %}
      {{ form.as_p }}
      <input type="submit" value="Search">
  </form>
  <br>
  <h1>Search Results</h1>
  <table class="socialSearch">
      <thead>
          <th><b>Username</b></th>
          <th><b>First Name</b></th>
          <th><b>Last Name</b></th>
          <th><b>Profile</b></th>
          <th><b>Attributes</b></th>
          <th><b>Waivers</b></th>
      </thead>
	  <tbody>
      {% for user in results %}
	  <tr onClick="window.location='/userprofile/staff/{{user.pk}}';">
          <td>{{user.username}}</td>
          <td>{{user.first}}</td>
          <td>{{user.last}}</td>
          <td>
              <a href="/userprofile/view/{{user.pk}}">view</a> /
              <a href="/userprofile/staff/{{user.pk}}">edit</a>
          </td>
          <td>
              <a href="/userattributes/{{user.pk}}">modify</a>
          </td>
          <td>
              <a href="/waivers/signed/{{user.pk}}">signed</a> /
              <a href="/waivers/unsigned/{{user.pk}}">unsigned</a>
          </td>
      </tr>
      {% endfor %}
	  </tbody>
  </table>
{% endblock %}